  function [yn,cvecn]=cmiss(y,cvec)
% function [yn,cvecn]=cmiss(y,cvec)
% Clear MISSing Values 
% y     data matrix 
% cvec   calendar vector
%
% yn is the matrix with all rows corresponding to non-zero 
% entries in all columns 
% cvecn is the associated calendar vector 
% 
[m,n]=size(y); 
if size(cvec,1) ~= m; error('Mismatch y & cvec'); end; 

ii=find( isnan(y) ~= 1);
if n > 1; 
    imat=zeros(m,n); 
    imat(ii) =1; 
    ii=find( sum(imat,2)/n == 1);  
end; 
yn=y(ii,:); 
cvecn=cvec(ii); 